package com.swim.sys.web;

import com.jeesite.common.config.Global;
import com.jeesite.common.web.BaseController;
import com.swim.sys.entity.WebMenu;
import com.swim.sys.service.WebMenuService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping(value = "${adminPath}/sys/indexMenu")
public class IndexMenuController extends BaseController {

    @Resource
    WebMenuService webMenuService;

    @GetMapping(value = "listMenus")
    public String listMenus() {
        WebMenu webMenu = new WebMenu();
        webMenu.setStatus(String.valueOf(0));
        List<WebMenu> webMenuList = webMenuService.findList(webMenu);
        return renderResult(Global.TRUE, text("数据查询成功"), webMenuList);
    }
}
